import React, {
    Component
} from 'react'
import {
    render
} from 'react-dom'
import {
    Router,
    Route,
    IndexRoute,
    hashHistory
} from 'react-router'

//引用样式
import './Scss/reset.scss'
import './scss/media.px'
import './scss/public.scss'
import './scss/integral.scss'

//引入vconsole调试
// import './js/vconsole.js'

//引入组件

//公共盒子

const Roots = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Common/Roots').default)
    }, 'Roots')
}
const iframe = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Common/iframe').default)
    }, 'iframe')
}

//积分商城
const Integral = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Integral').default)
    }, 'Integral')
}
const IntegralMyself = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/IntegralMyself').default)
    }, 'IntegralMyself')
}
const TaskToday = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/TaskToday').default)
    }, 'TaskToday')
}
const Umtauschen = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Umtauschen').default)
    }, 'Umtauschen')
}
const MyPackage = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/MyPackage').default)
    }, 'MyPackage')
}
const myOrder = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/myOrder').default)
    }, 'myOrder')
}
const orderDetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/orderDetail').default)
    }, 'orderDetail')
}
const packageDetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/packageDetail').default)
    }, 'packageDetail')
}
const ProductDetails = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/ProductDetails').default)
    }, 'ProductDetails')
}
const ProductMore = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/ProductMore').default)
    }, 'ProductMore')
}
const companyInfo = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/companyInfo').default)
    }, 'companyInfo')
}
const companyIntro = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/companyIntro').default)
    }, 'companyIntro')
}
const integralInfo = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/integralInfo').default)
    }, 'integralInfo')
}
const position = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/position').default)
    }, 'position')
}
render((
    <Router history={hashHistory}>
        <Route path='/' getComponent={Roots}>
            <IndexRoute getComponent={Integral}/>
            <Route path='iframe/:sign/:title/:url' getComponent={iframe}/>
            <Route path='Integral' getComponent={Integral}/>
            <Route path='IntegralMyself' getComponent={IntegralMyself}/>
            <Route path='TaskToday' getComponent={TaskToday}/>
            <Route path='Umtauschen' getComponent={Umtauschen}/>
            <Route path='MyPackage' getComponent={MyPackage}/>
            <Route path='myOrder' getComponent={myOrder}/>
            <Route path='orderDetail/:id' getComponent={orderDetail}/>
            <Route path='packageDetail/:id' getComponent={packageDetail}/>
            <Route path='ProductDetails/:id' getComponent={ProductDetails}/>
            <Route path='ProductMore/:id' getComponent={ProductMore}/>
            <Route path='integralInfo' getComponent={integralInfo}/>
            <Route path='companyInfo/:id' getComponent={companyInfo}/>
            <Route path='companyDetail/:id' getComponent={companyIntro}/>
            <Route path='position/:title/:address/:lng/:lnt' getComponent={position}/>
        </Route>
    </Router>
), document.getElementById('app'));
